<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <script language="JavaScript" type="text/javascript" src="cbrte/html2xhtml.min.js"></script>
        <script language="JavaScript" type="text/javascript" src="cbrte/richtext_compressed.js"></script>
        <script language="JavaScript" type="text/javascript" src="js/ajaxSendMail.js"></script>
        <script language="JavaScript" type="text/javascript" src="js/addFile.js"></script>
        <link rel="stylesheet" type="text/css" href="css/clientTemplate.css">
        <link rel="stylesheet" type="text/css" href="css/mailControl.css">

        <title>Client Template</title>
    </head>
    <body>
        <center>
            <table id="tableClientTemplate">
                <tr id="headerClientTemplate">
                    <td><%@include file="clientHeader.jsp" %></td>
                </tr>
                <tr id="middleClientTemplate">
                    <td>
                        <table>
                            <td class="tdControl2"><a class="three" href="inbox.jsp">Inbox</a></td>
                            <td class="tdControl2"><a class="three" href="sentMail.jsp">Sent Mail</a></td>
                            <td class="tdControl"><a class="three" href="composeMail.jsp">Compose Mail</a></td>
                        </table>

                        <form name="RTEDemo" action="CommonsFileUploadServlet" enctype="multipart/form-data" method="post" onsubmit="return submitForm();">
                            <input type ="button" value="Send" onclick="sendMail();" style="width:10em; height: 3em;"/><br/>
                            <br/>
                            <table border="1" style="text-align: left">
                                <tr>
                                    <td style="width: 100px">To</td>
                                    <td><textarea rows="2" cols="110" name="txtTo"><% if(request.getParameter("reply") != null) out.print(request.getParameter("reply"));%></textarea></td>
                                </tr>
                                <tr>
                                    <td>Cc</td>
                                    <td><textarea rows="2" cols="110" name="txtCc"></textarea></td>
                                </tr>
                                <tr>
                                    <td>Bcc</td>
                                    <td><textarea rows="2" cols="110" name="txtBcc"></textarea></td>
                                </tr>
                                <tr>
                                    <td>Subject</td>
                                    <td><input type="text" size="145" name="txtSubject"/></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div id="fileArray">
                                            <input type="file" name="file1" size="40"/><br>
                                        </div>
                                        <a href="#" onclick="addFileField();">Attach more file</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <script language="JavaScript" type="text/javascript">
                                            <!--
                                            //Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML, encHTML)
                                            initRTE("cbrte/images/", "cbrte/", "", true);
                                            //-->
                                        </script>
                                        <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
                                        <script language="JavaScript" type="text/javascript">
                                            <!--
                                            //build new richTextEditor
                                            var rte1 = new richTextEditor('rte1');
                                            rte1.html = 'here&#39;s the "\<em\>preloaded\<\/em\>&nbsp;\<b\>content\<\/b\>"';

                                            //enable all commands for demo
                                            rte1.cmdFormatBlock = true;
                                            rte1.cmdFontName = true;
                                            rte1.cmdFontSize = true;
                                            rte1.cmdIncreaseFontSize = true;
                                            rte1.cmdDecreaseFontSize = true;

                                            rte1.cmdBold = true;
                                            rte1.cmdItalic = true;
                                            rte1.cmdUnderline = true;
                                            rte1.cmdStrikethrough = true;
                                            rte1.cmdSuperscript = true;
                                            rte1.cmdSubscript = true;

                                            rte1.cmdJustifyLeft = true;
                                            rte1.cmdJustifyCenter = true;
                                            rte1.cmdJustifyRight = true;
                                            rte1.cmdJustifyFull = true;

                                            rte1.cmdInsertHorizontalRule = true;
                                            rte1.cmdInsertOrderedList = true;
                                            rte1.cmdInsertUnorderedList = true;

                                            rte1.cmdOutdent = true;
                                            rte1.cmdIndent = true;
                                            rte1.cmdForeColor = true;
                                            rte1.cmdHiliteColor = true;
                                            rte1.cmdInsertLink = true;
                                            rte1.cmdInsertImage = true;
                                            rte1.cmdInsertSpecialChars = true;
                                            rte1.cmdInsertTable = true;
                                            rte1.cmdSpellcheck = true;

                                            rte1.cmdCut = true;
                                            rte1.cmdCopy = true;
                                            rte1.cmdPaste = true;
                                            rte1.cmdUndo = true;
                                            rte1.cmdRedo = true;
                                            rte1.cmdRemoveFormat = true;
                                            rte1.cmdUnlink = true;

                                            rte1.toggleSrc = false;

                                            rte1.build();
                                            //-->
                                        </script>
                                    </td>
                                </tr>
                            </table>

                        </form>
                        <br/>
                    </td>
                </tr>
                <tr id="footerClientTemplate">
                    <td><%@include file="clientFooter.jsp" %></td>
                </tr>
            </table>
        </center>
    </body>
</html>
